<?php
//Select ra các tin hot
$sql = 'SELECT new_id, new_title, new_content, new_date FROM news ORDER BY new_date DESC LIMIT 0,3';
//$db = new db_query($sql);
//$news_row = $db->resultArray();
$db = new DBQuery;
$news_row = $db->query($sql);
?>
<div class="newsView fr">
	<p class="newsViewP">
        <marquee scrollamount="2" width="97%" onmouseover="this.stop();" onmouseout="this.start();">
        <?php foreach($news_row as $news): ?>
        <a class="news_hot_bar" data-value="<?php echo $news['new_id']?>"><?php echo cut_string($news['new_title'],50)?></a>
        <?php endforeach;?>
        </marquee>
    </p>
    <div class="newViewCt">
        <!-- Load ajax trong này -->
    </div>
</div>
<script>
    $(document).ready(function(){
        var flag = false;
        $('.news_hot_bar').mouseover(function(){
            console.log(this);
            control_module[0].id = $(this).attr('data-value');
            $('.newViewCt').slideDown('fast',function(){
                if($(this).css('display')=='block'){
                    loadModule(this,control_module[0],true);    
                }
            }).hover(function(){
                flag = true;
            },function(){
                flag = false;
            });
            $('html').mouseup(function(){
                if(!flag){
                    $('.newViewCt').hide();
                }
            });
        });
    });
</script>